<!--
 * @Author: your name
 * @Date: 2021-05-25 16:57:51
 * @LastEditTime: 2021-05-27 14:40:27
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \遵义报名\zunyi\src\components\myinput.vue
-->
<template>
 <el-input 
    placeholder="请输入内容" 
    :value="value" 
    @input="inputHandler" 
    :disabled="isDisabled" 
    :type="type"
    class="input"></el-input>
</template>

<script>
export default {
    props:{
        data:{//输入的内容
            type:String
        },
        isDisabled:{//是否禁用
            type:Boolean,
            default:false
        },
        type:{//输入框类型
            type:String,
            default:"text"
        }
    },
    model:{
        prop:"data",
        event:"change"
    },
    data(){
        return{
            // value:this.data ? this.data : ""//输入内容
            value:this.data
        }
    },
    methods:{
        inputHandler(value){
            this.value = value
            this.$emit("change",this.value)
        }
    }

}
</script>

<style lang="scss" scoped>
    .input{
        /deep/   textarea{
            resize:none;
        }
    }
</style>